const accountInfo = wx.getAccountInfoSync()
const env = accountInfo.miniProgram.envVersion
let mainMenus = {
  hbydy: [
    {
      title: '预约/挂号',
      subTitle: '科室、医生排班信息',
      img: 'appointment.png?time=1',
      url: '/pages/home/districtList/districtList',
    },
    {
      title: '电子健康卡',
      subTitle: '建档 / 绑卡',
      img: 'health-card.png',
      url: '/pages/me/healthCard/healthCard',
    },
  ],
  fhqq: [
    {
      title: '预约/挂号',
      subTitle: '科室、医生排班信息',
      img: 'appointment.png?time=1',
      url: '/pages/home/districtList/districtList',
    },
    {
      title: '充值',
      subTitle: '就诊卡充值',
      img: 'recharge.png?time=1',
      url: '/pages/home/refund/refund',
    },
  ],
}
let subMenus = {
  hbydy: [
    {
      title: '智能导诊',
      img: 'guide.png?time=5',
      url: '',
      appid: 'wx5c5218393995d039',
      openMini: true,
      path: '',
    },
    {
      title: '签到',
      subTitle: '预约签到',
      img: 'sign.png',
      url: '/pages/home/signList/list',
      needLogin: true
    },
    {
      title: '候诊查询',
      subTitle: '及时关注不过号',
      img: 'wait.png',
      url: '/pages/home/signList/list?signed=true',
      needLogin: true,
    },
    {
      title: '报告查询',
      subTitle: '检验检查报告',
      img: 'report.png?time=5',
      url: '/pages/home/outpatientReport/outpatientReport'
    },
    {
      title: '门诊结算',
      subTitle: '诊间缴费',
      img: 'pay.png?time=5',
      url: '/pages/inquiry/index/index?from=pay',
      needLogin: true
    },
    {
      title: '充值',
      subTitle: '',
      img: 'recharge.png?time=5',
      url: '/pages/home/refund/refund',
      needLogin: true
    },
    // {
    //   title: '建档/绑卡',
    //   subTitle: '在线 极速 建档',
    //   img: 'bind.png?time=6',
    //   url: '/pages/me/manage/index',
    //   needLogin: true,
    // },
    {
      title: '住院服务',
      subTitle: '住院预缴金',
      img: 'inpatient.png?time7',
      url: '/pages/home/inpatientServices/inpatientServices',
      needLogin: true
    },
    {
      title: '点餐服务',
      subTitle: '提供订餐服务',
      img: 'food.png',
      url: '/pages/home/webview/webview?title=点餐服务&url=' + encodeURIComponent('https://hz-99.dc78.cn/000064.html?p=hbykdx')
    },
    {
      title: '综合查询',
      subTitle: '信息快速查询',
      img: 'query.png?time=7',
      url: '/pages/home/comprehensiveQuery/comprehensiveQuery'
    },
    {
      title: '救护车预约',
      subTitle: '',
      img: 'ambulance.png',
      url: '/pages/home/ambulance/ambulance',
      needLogin: false,
    },
    {
      title: '院内导航',
      subTitle: '',
      img: 'navigation.png?time=5',
      url: '',
      appid: 'wx83884e3a215b20f4',
      openMini: true,
      path: 'pages/map/mapView?buildId=07K802&url=https%3A%2F%2Fhis.ipalmap.com%2Fnavigation%2Fdist%2Findex.html%23%2Fmap%3FappsId%3D1237'
    },
    // {
    //   title: '体检预约',
    //   subTitle: '体检预约',
    //   img: 'health-check.png',
    //   url: '/pages/home/webview/webview?title=体检预约&url=' + encodeURIComponent('https://www.donghaowang.com/index.php?g=Wap&m=Custom&a=index&token=btalmf1543071087&id=4')
    // },
    {
      title: '病历复印',
      subTitle: '',
      img: 'print.png',
      url: '/pages/home/print/print',
      needLogin: true,
    },
    {
      title: '电子发票',
      subTitle: '',
      img: 'receipt.png',
      url: '/pages/home/receipt/receipt',
      needLogin: true,
    },
    {
      title: '核酸检测',
      subTitle: '',
      img: 'nat.png',
      url: '/pages/home/nat/nat',
      needLogin: true,
    },
  ],
  fhqq: [
    {
      title: '签到',
      subTitle: '预约签到',
      img: 'sign.png',
      url: '/pages/home/signList/list',
      needLogin: true
    },
    {
      title: '候诊查询',
      subTitle: '及时关注不过号',
      img: 'wait.png',
      url: '/pages/home/signList/list?signed=true',
      needLogin: true,
    },
    {
      title: '门诊结算',
      subTitle: '诊间缴费',
      img: 'pay.png?time=5',
      url: '/pages/inquiry/index/index?from=pay',
      needLogin: true
    },
    {
      title: '建档/绑卡',
      subTitle: '在线 极速 建档',
      img: 'bind.png?time=5',
      url: '/pages/me/manage/index',
      needLogin: true,
    },
    {
      title: '住院服务',
      subTitle: '住院预缴金',
      img: 'inpatient.png?time=6',
      url: '/pages/home/inpatientServices/inpatientServices',
      needLogin: true
    },
    {
      title: '综合查询',
      subTitle: '信息快速查询',
      img: 'query.png?time=6',
      url: '/pages/home/comprehensiveQuery/comprehensiveQuery'
    },
    {
      title: '报告查询',
      subTitle: '检验检查报告',
      img: 'report.png',
      url: '/pages/home/outpatientReport/outpatientReport'
    },
    {
      title: '电子就诊卡',
      subTitle: '',
      img: 'wait.png',
      url: '/pages/me/qqheCard/qqheCard',
      needLogin: true,
    },
  ]
}

if (env === 'release') {
  let list = subMenus.hbydy
  subMenus.hbydy = list.filter(item => item.title !== '病历复印' && item.title !== '电子发票' && item.title !== '核酸检测')
}

module.exports = {mainMenus, subMenus}
